{{include template('public/header','admin')}}
<body>
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <form method="post" action="/admin/module/batchremove" class="form-inline" role="form">
                    <table id='ModuleList' class="table table-condensed table-hover table-striped tablesorter table-fixed table-selectable">
                        <thead>
                            <tr>
                                <th>{{L('module_name')}}</th>
                                <th>{{L('module_module')}}</th>
                                <th>{{L('module_version')}}</th>
                                <th>{{L('module_installdate')}}</th>
                                <th>{{L('module_updatedate')}}</th>
                                <th>{{L('edit')}}</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{foreach $modules as $item}}
                            {{if $item.exists eq '1'}}
                            <tr>
                                <td >{{$item['name']}}</td>
                                <td >{{$item['module']}}</td>
                                <td >{{$item['version']}}</td>
                                <td >{{$item['installdate']}}</td>
                                <td >{{$item['updatedate']}}</td>
                                <td style="width: 15%">
                                    {{if $item['iscore']}}
                                    <span style="color:#999">禁止</span>
                                    {{else}}
                                    <span><a href="javascript:void(0);" onclick="uninstall('卸载','/admin/module/uninstall/?module={{$item['module']}}')" style="color:red">卸载</a></span>
                                    {{/if}}
                                </td>
                            </tr>
                            {{else}}
                            <tr path='{{$item.path}}'>
                                <td></td>
                                <td>{{$item.module}}</td>
                                <td>未知</td>
                                <td>未安装</td>
                                <td>未安装</td>
                                <td>
                                    {{if $item.isinstall eq "1" }}
                                    <span><a href="javascript:void(0);" onclick="layer_open('模块安装', '/admin/module/install/?module={{$item['module']}}', '550', '325')"
                                             style="color:#009933">安装</a>
                                    </span>
                                    {{else}}
                                    <span style="color:#009933">无法安装</span>
                                    {{/if}}
                                </td>
                            </tr>
                            {{/if}}
                            {{/foreach}}
                        </tbody>
                        <tr>
                            <td colspan="15">
                                <div style="text-align: left;">
                                    {{include template('public/page','admin')}}
                                </div>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function uninstall(m, url){
        layer.confirm('确认要卸载 ' + m + ' 模块吗？', function(index){
        window.location.href = url;
        });
        }
    </script>
</body>
</html>
